import React from 'react'
import cx from 'classnames'
import style from './style'

class Checkbox extends React.Component {
	render() {
		let { active, label, className, disabled, ...others } = this.props
    if (disabled) {
      others.onClick = null;
    }
		return (
			<div className={cx({
				[style.root]: true,
				[className]: !!className,
				[style.active]: active,
				[style.disabled]: disabled
			})}
			{...others}
		 	>
				<div>
					<input type="checkbox"/>
					<i></i>
					<label>{label}</label>
				</div>
			</div>
		)
	}
}

export default Checkbox
